import request from '@/config/axios'

export interface IpLimitVO {
  id: number
  ip: string
  ipLocation: string
  limitType: number
}

// 查询ip限制屏蔽列表
export const getIpLimitPage = async (params) => {
  return await request.get({ url: '/cms/ip-limit/page', params })
}

// 查询ip限制屏蔽详情
export const getIpLimit = async (id: number) => {
  return await request.get({ url: '/cms/ip-limit/get?id=' + id })
}

// 新增ip限制屏蔽
export const createIpLimit = async (data: IpLimitVO) => {
  return await request.post({ url: '/cms/ip-limit/create', data })
}

// 删除ip限制屏蔽
export const deleteIpLimit = async (id: number) => {
  return await request.delete({ url: '/cms/ip-limit/delete?id=' + id })
}

// 导出ip限制屏蔽 Excel
export const exportIpLimitApi = async (params) => {
  return await request.download({ url: '/cms/ip-limit/export-excel', params })
}
